package de.baumann.browser.api.net

import de.baumann.browser.api.net.base.BaseUrl
import de.baumann.browser.api.net.vo.Like
import de.baumann.browser.api.net.vo.Result
import io.reactivex.Observable
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.POST

@BaseUrl(ApiKey.CMS_HOST)
interface CMSApiService {
    @FormUrlEncoded
    @POST(ApiKey.QUERYLIKED)
    fun queryLiked(@Field("article_id") article_id: String): Observable<Result<Like>>

    @FormUrlEncoded
    @POST(ApiKey.GIVELIKE)
    fun like(@Field("article_id") article_id: String,
             @Field("is_like") is_like: Int): Observable<Result<Any>>

    @FormUrlEncoded
    @POST(ApiKey.GIVECOMMENT)
    fun comment(@Field("user_name") userName: String,
                @Field("article_id") article_id: String,
                @Field("content") content: String): Observable<Result<Any>>

    @FormUrlEncoded
    @POST(ApiKey.GIVECOMPLAINT)
    fun complaint(@Field("article_id") article_id: String,
                  @Field("content") content: String): Observable<Result<Any>>

    @FormUrlEncoded
    @POST(ApiKey.ADDWATCHODIN)
    fun addwatchodin(@Field("article_id") article_id: String): Observable<Result<Any>>

}